import { Configuration, DnsApi,IcmpApi,ScanApi } from "@linksaas-minapp/netutil-api";

export function getDnsApi(): DnsApi {
    return new DnsApi(new Configuration({
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        basePath: "http://" + (window as any).minApp.netUtilAddr,
    }));
}

export function getIcmpApi(): IcmpApi {
    return new IcmpApi(new Configuration({
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        basePath: "http://" + (window as any).minApp.netUtilAddr,
    }));
}

export function getScanApi(): ScanApi {
    return new ScanApi(new Configuration({
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        basePath: "http://" + (window as any).minApp.netUtilAddr,
    }));
}

export function getToken(): string {
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    return (window as any).minApp.netUtilToken ?? "";
}
